

cmake_minimum_required(VERSION 3.15) 
project(hello_world)
set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
# add_definitions(-DCMAKE_OSX_ARCHITECTURES=arm64;x86_64)
# CMAKE_OSX_DEPLOYMENT_TARGET
# CMAKE_OSX_SYSROOT
# $ cmake -S. -B_builds -GXcode \
# -DCMAKE_SYSTEM_NAME=iOS \
# "-DCMAKE_OSX_ARCHITECTURES=armv7;armv7s;arm64;i386;x86_64" \
# -DCMAKE_OSX_DEPLOYMENT_TARGET=9.3 \
# -DCMAKE_INSTALL_PREFIX=`pwd`/_install \
# -DCMAKE_XCODE_ATTRIBUTE_ONLY_ACTIVE_ARCH=NO \
# -DCMAKE_IOS_INSTALL_COMBINED=YES
# set(CMAKE_OSX_SYSROOT "/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk")
# add_definitions(-DCMAKE_SYSTEM_NAME=Darwin)
# set(CMAKE_SYSTEM_NAME Darwin)
# # set(CMAKE_REQUIRED_LINK_OPTIONS "-arch;arm64")
# set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -target arm64-apple-macos12.3")
# set(CMAKE_APPLE_SILICON_PROCESSOR arm64)
# add_definitions(-DCMAKE_APPLE_SILICON_PROCESSOR=arm64)
aux_source_directory(${PROJECT_SOURCE_DIR}/src/src source_directory)
FILE(GLOB_RECURSE SOURCE_FILES ${PROJECT_SOURCE_DIR}/src/*.cpp)
message(source_directory=${source_directory})
message(SOURCE_FILES=${SOURCE_FILES})
include_directories(${PROJECT_SOURCE_DIR}/src/include)
add_executable(${PROJECT_NAME} ${SOURCE_FILES} ${PROJECT_SOURCE_DIR}/src/main.cpp)

# function(retrieve_files out_files)
#     set(source_list)
#     foreach(dirname ${ARGN})
#         file(GLOB_RECURSE files RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}
# 			# "${dirname}/*.cmake"
#             "${dirname}/*.h"
#             "${dirname}/*.hpp"
#             "${dirname}/*.c"
#             "${dirname}/*.cpp"
#             "${dirname}/*.cc"            
#         )
#         foreach(filename ${files})
#             list(APPEND source_list "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
# 			set(file_abs_path "${CMAKE_CURRENT_SOURCE_DIR}/${filename}")
# 			get_filename_component(source_path "${filename}" PATH)
#             string(REPLACE "/" "\\" filter_dir "${source_path}")
#             source_group("${filter_dir}" FILES "${filename}")
#         endforeach()
#     endforeach()
#     set(${out_files} ${source_list} PARENT_SCOPE)
#     # message(out_files=${out_files})
#     # message(source_list=${source_list})
# endfunction()
# retrieve_files(result ${CMAKE_CURRENT_SOURCE_DIR})
# message("Value returned : ${result}")  # Will be "Hello World"